if (self->max_texture_size < 0)
{
glGetIntegerv (GL_MAX_TEXTURE_SIZE, (GLint *) &self->max_texture_size);
- GSK_NOTE (OPENGL, g_print ("GL max texture size: %d\n", self->max_texture_size));
+ GSK_NOTE (OPENGL, g_message ("GL max texture size: %d", self->max_texture_size));
}
glBindFramebuffer (GL_FRAMEBUFFER, 0);
#ifdef G_ENABLE_DEBUG
GSK_NOTE (OPENGL,
- g_print ("Textures created: %ld\n"
+ g_message ("Textures created: %ld\n"
" Textures reused: %ld\n"
- " Surface uploads: %ld\n",
+ " Surface uploads: %ld",
gsk_profiler_counter_get (self->profiler, self->counters.created_textures),
gsk_profiler_counter_get (self->profiler, self->counters.reused_textures),
gsk_profiler_counter_get (self->profiler, self->counters.surface_uploads)));
#endif
GSK_NOTE (OPENGL,
- g_print ("*** Frame end: textures=%d\n",
+ g_message ("*** Frame end: textures=%d",
g_hash_table_size (self->textures)));
self->in_frame = FALSE;
t = find_texture_by_size (self->textures, width, height);
if (t != NULL && !t->in_use && t->user == NULL)
{
- GSK_NOTE (OPENGL, g_print ("Reusing Texture(%d) for size %dx%d\n",
+ GSK_NOTE (OPENGL, g_message ("Reusing Texture(%d) for size %dx%d",
t->texture_id, t->width, t->height));
t->in_use = TRUE;
void
gsk_gl_glyph_cache_init (GskGLGlyphCache *self,
+ GskRenderer *renderer,
GskGLDriver *gl_driver)
{
self->hash_table = g_hash_table_new_full (glyph_cache_hash, glyph_cache_equal,
self->atlases = g_ptr_array_new_with_free_func (free_atlas);
g_ptr_array_add (self->atlases, create_atlas (self));
+ self->renderer = renderer;
self->gl_driver = gl_driver;
}
atlas->num_glyphs++;
#ifdef G_ENABLE_DEBUG
- if (GSK_DEBUG_CHECK(GLYPH_CACHE))
+ if (GSK_RENDERER_DEBUG_CHECK (cache->renderer, GLYPH_CACHE))
{
g_print ("Glyph cache:\n");
for (i = 0; i < cache->atlases->len; i++)
for (l = atlas->dirty_glyphs, i = 0; l; l = l->next, i++)
render_glyph (atlas, (DirtyGlyph *)l->data, ®ions[i]);
- GSK_NOTE (GLYPH_CACHE,
- g_print ("uploading %d glyphs to cache\n", num_regions));
+ GSK_RENDERER_NOTE (self->renderer, GLYPH_CACHE,
+ g_message ("uploading %d glyphs to cache", num_regions));
gsk_gl_image_upload_regions (atlas->image, self->gl_driver, num_regions, regions);
if (atlas->old_pixels > MAX_OLD * atlas->width * atlas->height)
{
- GSK_NOTE(GLYPH_CACHE,
- g_print ("Dropping atlas %d (%g.2%% old)\n",
+ GSK_RENDERER_NOTE(self->renderer, GLYPH_CACHE,
+ g_message ("Dropping atlas %d (%g.2%% old)",
i, 100.0 * (double)atlas->old_pixels / (double)(atlas->width * atlas->height)));
if (atlas->image)
}
}
- GSK_NOTE(GLYPH_CACHE, g_print ("Dropped %d glyphs\n", dropped));
+ GSK_RENDERER_NOTE(self->renderer, GLYPH_CACHE, g_message ("Dropped %d glyphs", dropped));
}
#include "gskgldriverprivate.h"
#include "gskglimageprivate.h"
+#include "gskrendererprivate.h"
#include <pango/pango.h>
#include <gdk/gdk.h>
typedef struct
{
GskGLDriver *gl_driver;
+ GskRenderer *renderer;
GHashTable *hash_table;
GPtrArray *atlases;
} GskGLCachedGlyph;
void gsk_gl_glyph_cache_init (GskGLGlyphCache *self,
+ GskRenderer *renderer,
GskGLDriver *gl_driver);
void gsk_gl_glyph_cache_free (GskGLGlyphCache *self);
void gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self);
if (self->has_buffers)
return;
- GSK_NOTE (OPENGL, g_print ("Creating buffers (w:%d, h:%d, scale:%d)\n", width, height, scale_factor));
+ GSK_RENDERER_NOTE (GSK_RENDERER (self), OPENGL, g_message ("Creating buffers (w:%d, h:%d, scale:%d)", width, height, scale_factor));
if (self->texture_id == 0)
{
if (!self->has_buffers)
return;
- GSK_NOTE (OPENGL, g_print ("Destroying buffers\n"));
+ GSK_RENDERER_NOTE (GSK_RENDERER (self), OPENGL, g_message ("Destroying buffers"));
gdk_gl_context_make_current (self->gl_context);
self->gl_profiler = gsk_gl_profiler_new (self->gl_context);
self->gl_driver = gsk_gl_driver_new (self->gl_context);
- GSK_NOTE (OPENGL, g_print ("Creating buffers and programs\n"));
+ GSK_RENDERER_NOTE (renderer, OPENGL, g_message ("Creating buffers and programs"));
if (!gsk_gl_renderer_create_programs (self, error))
return FALSE;
- gsk_gl_glyph_cache_init (&self->glyph_cache, self->gl_driver);
+ gsk_gl_glyph_cache_init (&self->glyph_cache, renderer, self->gl_driver);
return TRUE;
}
int width = viewport->size.width;
int height = viewport->size.height;
- GSK_NOTE (OPENGL, g_print ("glViewport(0, 0, %d, %d) [scale:%d]\n",
+ GSK_RENDERER_NOTE (GSK_RENDERER (self), OPENGL, g_message ("glViewport(0, 0, %d, %d) [scale:%d]",
width,
height,
self->scale_factor));
g_array_remove_range (self->render_ops, 0, self->render_ops->len);
removed_textures = gsk_gl_driver_collect_textures (self->gl_driver);
- GSK_NOTE (OPENGL, g_print ("Collected: %d textures\n", removed_textures));
+ GSK_RENDERER_NOTE (GSK_RENDERER (self), OPENGL, g_message ("Collected: %d textures", removed_textures));
}
static void
gsk_gl_renderer_clear (GskGLRenderer *self)
{
- GSK_NOTE (OPENGL, g_print ("Clearing viewport\n"));
+ GSK_RENDERER_NOTE (GSK_RENDERER (self), OPENGL, g_message ("Clearing viewport"));
glClearColor (0, 0, 0, 0);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
if (self->gl_context == NULL)
{
- GSK_NOTE (OPENGL, g_print ("No valid GL context associated to the renderer"));
+ GSK_RENDERER_NOTE (renderer, OPENGL, g_message ("No valid GL context associated to the renderer"));
return;
}
{ "staging-buffer", GSK_RENDERING_MODE_STAGING_BUFFER }
};
-gboolean
-gsk_check_debug_flags (GskDebugFlags flags)
+static guint gsk_debug_flags;
+
+static void
+init_debug_flags (void)
{
#ifdef G_ENABLE_DEBUG
static volatile gsize gsk_debug_flags__set;
- static guint gsk_debug_flags;
if (g_once_init_enter (&gsk_debug_flags__set))
{
g_once_init_leave (&gsk_debug_flags__set, TRUE);
}
+#endif
+}
+
+gboolean
+gsk_check_debug_flags (GskDebugFlags flags)
+{
+ init_debug_flags ();
return (gsk_debug_flags & flags) != 0;
-#else
- return FALSE;
-#endif
+}
+
+GskDebugFlags
+gsk_get_debug_flags (void)
+{
+ init_debug_flags ();
+
+ return gsk_debug_flags;
}
gboolean
GSK_DEBUG_GLYPH_CACHE = 1 << 7
} GskDebugFlags;
-#define GSK_DEBUG_ANY ((1 << 9) - 1)
+#define GSK_DEBUG_ANY ((1 << 8) - 1)
typedef enum {
GSK_RENDERING_MODE_GEOMETRY = 1 << 0,
GSK_RENDERING_MODE_STAGING_BUFFER = 1 << 5
} GskRenderingMode;
+GskDebugFlags gsk_get_debug_flags (void);
gboolean gsk_check_debug_flags (GskDebugFlags flags);
gboolean gsk_check_rendering_flags (GskRenderingMode flags);
#ifdef G_ENABLE_DEBUG
#define GSK_DEBUG_CHECK(type) G_UNLIKELY (gsk_check_debug_flags (GSK_DEBUG_ ## type))
-#define GSK_DEBUG_CHECK2(type1,type2) G_UNLIKELY (gsk_check_debug_flags (GSK_DEBUG_ ## type1 | GSK_DEBUG_ ## type2))
#define GSK_RENDER_MODE_CHECK(type) G_UNLIKELY (gsk_check_rendering_flags (GSK_RENDERING_MODE_ ## type))
+#define GSK_RENDERER_DEBUG_CHECK(renderer,type) \
+ G_UNLIKELY ((gsk_renderer_get_debug_flags (renderer) & GSK_DEBUG_ ## type) != 0)
#define GSK_NOTE(type,action) G_STMT_START { \
if (GSK_DEBUG_CHECK (type)) { \
action; \
} } G_STMT_END
-
-#define GSK_NOTE2(type1,type2,action) G_STMT_START { \
- if (GSK_DEBUG_CHECK2 (type1, type2)) { \
- action; \
+#define GSK_RENDERER_NOTE(renderer,type,action) G_STMT_START { \
+ if (GSK_RENDERER_DEBUG_CHECK (renderer,type)) { \
+ action; \
} } G_STMT_END
+
#else
#define GSK_RENDER_MODE_CHECK(type) 0
#define GSK_DEBUG_CHECK(type) 0
-#define GSK_DEBUG_CHECK2(type1,type2) 0
+#define GSK_RENDERER_DEBUG_CHECK(renderer,type) 0
#define GSK_NOTE(type,action)
-#define GSK_NOTE2(type1,type2,action)
+#define GSK_RENDERER_NOTE(renderer,type,action)
#endif
GskProfiler *profiler;
+ GskDebugFlags debug_flags;
+
gboolean is_realized : 1;
} GskRendererPrivate;
GskRendererPrivate *priv = gsk_renderer_get_instance_private (self);
priv->profiler = gsk_profiler_new ();
+ priv->debug_flags = gsk_get_debug_flags ();
}
/**
texture = GSK_RENDERER_GET_CLASS (renderer)->render_texture (renderer, root, viewport);
#ifdef G_ENABLE_DEBUG
- if (GSK_DEBUG_CHECK (RENDERER))
+ if (GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER))
{
GString *buf = g_string_new ("*** Texture stats ***\n\n");
GSK_RENDERER_GET_CLASS (renderer)->render (renderer, root);
#ifdef G_ENABLE_DEBUG
- if (GSK_DEBUG_CHECK (RENDERER))
+ if (GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER))
{
GString *buf = g_string_new ("*** Frame stats ***\n\n");
if (gsk_renderer_realize (renderer, window, &error))
{
- if (verbose || GSK_DEBUG_CHECK (RENDERER))
+ if (verbose || GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER))
{
g_print ("Using renderer of type '%s' for window '%s'\n",
G_OBJECT_TYPE_NAME (renderer),
return renderer;
}
- if (verbose || GSK_DEBUG_CHECK (RENDERER))
+ if (verbose || GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER))
{
g_print ("Failed to realize renderer of type '%s' for window '%s': %s\n",
G_OBJECT_TYPE_NAME (renderer),
GSK_RENDERER_GET_CLASS (renderer)->end_draw_frame (renderer, context);
}
+GskDebugFlags
+gsk_renderer_get_debug_flags (GskRenderer *renderer)
+{
+ GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
+
+ g_return_val_if_fail (GSK_IS_RENDERER (renderer), 0);
+
+ return priv->debug_flags;
+}
+
+void
+gsk_renderer_set_debug_flags (GskRenderer *renderer,
+ GskDebugFlags flags)
+{
+ GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
+
+ g_return_if_fail (GSK_IS_RENDERER (renderer));
+
+ priv->debug_flags = flags;
+}
#include "gskrenderer.h"
#include "gskprofilerprivate.h"
+#include "gskdebugprivate.h"
G_BEGIN_DECLS
GskProfiler * gsk_renderer_get_profiler (GskRenderer *renderer);
+GskDebugFlags gsk_renderer_get_debug_flags (GskRenderer *renderer);
+void gsk_renderer_set_debug_flags (GskRenderer *renderer,
+ GskDebugFlags flags);
+
G_END_DECLS
#endif /* __GSK_RENDERER_PRIVATE_H__ */
if (!GSK_RENDER_MODE_CHECK (GEOMETRY))
{
- GSK_NOTE (CAIRO, g_print ("CLIP = { .x = %g, .y = %g, .width = %g, .height = %g }\n",
+ GSK_NOTE (CAIRO, g_message ("CLIP = { .x = %g, .y = %g, .width = %g, .height = %g }",
node->bounds.origin.x, node->bounds.origin.y,
node->bounds.size.width, node->bounds.size.height));
cairo_clip (cr);
}
- GSK_NOTE (CAIRO, g_print ("Rendering node %s[%p]\n",
+ GSK_NOTE (CAIRO, g_message ("Rendering node %s[%p]",
node->name ? node->name : node->node_class->type_name,
node));
node->bounds.size.width, node->bounds.size.height);
cairo_clip (res);
- if (GSK_DEBUG_CHECK (SURFACE))
+ if (GSK_RENDERER_DEBUG_CHECK (renderer, SURFACE))
{
const char *prefix;
prefix = g_getenv ("GSK_DEBUG_PREFIX");
if (graphene_matrix_to_2d (&self->transform, &ctm.xx, &ctm.yx, &ctm.xy, &ctm.yy, &ctm.x0, &ctm.y0))
{
- GSK_NOTE (CAIRO, g_print ("CTM = { .xx = %g, .yx = %g, .xy = %g, .yy = %g, .x0 = %g, .y0 = %g }\n",
+ GSK_NOTE (CAIRO, g_message ("CTM = { .xx = %g, .yx = %g, .xy = %g, .yy = %g, .x0 = %g, .y0 = %g }",
ctm.xx, ctm.yx,
ctm.xy, ctm.yy,
ctm.x0, ctm.y0));
#include "gskvulkanimageprivate.h"
#include "gskdebugprivate.h"
#include "gskprivate.h"
+#include "gskrendererprivate.h"
#include <graphene.h>
GObject parent_instance;
GdkVulkanContext *vulkan;
+ GskRenderer *renderer;
GHashTable *hash_table;
GPtrArray *atlases;
atlas->num_glyphs++;
#ifdef G_ENABLE_DEBUG
- if (GSK_DEBUG_CHECK(GLYPH_CACHE))
+ if (GSK_RENDERER_DEBUG_CHECK (cache->renderer, GLYPH_CACHE))
{
g_print ("Glyph cache:\n");
for (i = 0; i < cache->atlases->len; i++)
}
static void
-upload_dirty_glyphs (Atlas *atlas,
- GskVulkanUploader *uploader)
+upload_dirty_glyphs (GskVulkanGlyphCache *cache,
+ Atlas *atlas,
+ GskVulkanUploader *uploader)
{
GList *l;
guint num_regions;
for (l = atlas->dirty_glyphs, i = 0; l; l = l->next, i++)
render_glyph (atlas, (DirtyGlyph *)l->data, ®ions[i]);
- GSK_NOTE (GLYPH_CACHE,
- g_print ("uploading %d glyphs to cache\n", num_regions));
+ GSK_RENDERER_NOTE (cache->renderer, GLYPH_CACHE,
+ g_message ("uploading %d glyphs to cache", num_regions));
gsk_vulkan_image_upload_regions (atlas->image, uploader, num_regions, regions);
}
GskVulkanGlyphCache *
-gsk_vulkan_glyph_cache_new (GdkVulkanContext *vulkan)
+gsk_vulkan_glyph_cache_new (GskRenderer *renderer,
+ GdkVulkanContext *vulkan)
{
GskVulkanGlyphCache *cache;
cache = GSK_VULKAN_GLYPH_CACHE (g_object_new (GSK_TYPE_VULKAN_GLYPH_CACHE, NULL));
+ cache->renderer = renderer;
cache->vulkan = vulkan;
g_ptr_array_add (cache->atlases, create_atlas (cache));
atlas->image = gsk_vulkan_image_new_for_atlas (cache->vulkan, atlas->width, atlas->height);
if (atlas->dirty_glyphs)
- upload_dirty_glyphs (atlas, uploader);
+ upload_dirty_glyphs (cache, atlas, uploader);
return atlas->image;
}
if (atlas->old_pixels > MAX_OLD * atlas->width * atlas->height)
{
- GSK_NOTE(GLYPH_CACHE,
- g_print ("Dropping atlas %d (%g.2%% old)\n", i, 100.0 * (double)atlas->old_pixels / (double)(atlas->width * atlas->height)));
+ GSK_RENDERER_NOTE(cache->renderer, GLYPH_CACHE,
+ g_message ("Dropping atlas %d (%g.2%% old)", i, 100.0 * (double)atlas->old_pixels / (double)(atlas->width * atlas->height)));
g_ptr_array_remove_index (cache->atlases, i);
drops[i] = 1;
}
}
- GSK_NOTE(GLYPH_CACHE, g_print ("Dropped %d glyphs\n", dropped));
+ GSK_RENDERER_NOTE(cache->renderer, GLYPH_CACHE, g_message ("Dropped %d glyphs", dropped));
}
G_DECLARE_FINAL_TYPE(GskVulkanGlyphCache, gsk_vulkan_glyph_cache, GSK, VULKAN_GLYPH_CACHE, GObject)
-GskVulkanGlyphCache *gsk_vulkan_glyph_cache_new (GdkVulkanContext *vulkan);
+GskVulkanGlyphCache *gsk_vulkan_glyph_cache_new (GskRenderer *renderer,
+ GdkVulkanContext *vulkan);
GskVulkanImage * gsk_vulkan_glyph_cache_get_glyph_image (GskVulkanGlyphCache *cache,
GskVulkanUploader *uploader,
self->render = gsk_vulkan_render_new (renderer, self->vulkan);
- self->glyph_cache = gsk_vulkan_glyph_cache_new (self->vulkan);
+ self->glyph_cache = gsk_vulkan_glyph_cache_new (renderer, self->vulkan);
return TRUE;
}
}
#define FALLBACK(...) G_STMT_START { \
- GSK_NOTE (FALLBACK, g_print (__VA_ARGS__)); \
+ GSK_RENDERER_NOTE (gsk_vulkan_render_get_renderer (render), FALLBACK, g_message (__VA_ARGS__)); \
goto fallback; \
}G_STMT_END
return;
case GSK_SHADOW_NODE:
default:
- FALLBACK ("Unsupported node '%s'\n", node->node_class->type_name);
+ FALLBACK ("Unsupported node '%s'", node->node_class->type_name);
case GSK_REPEAT_NODE:
if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED;
else
- FALLBACK ("Repeat nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Repeat nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_REPEAT;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_BLEND_MODE_CLIP_ROUNDED;
else
- FALLBACK ("Blend nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Blend nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_BLEND_MODE;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_CROSS_FADE_CLIP_ROUNDED;
else
- FALLBACK ("Cross fade nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Cross fade nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_CROSS_FADE;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
case GSK_INSET_SHADOW_NODE:
if (gsk_inset_shadow_node_get_blur_radius (node) > 0)
- FALLBACK ("Blur support not implemented for inset shadows\n");
+ FALLBACK ("Blur support not implemented for inset shadows");
else if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
pipeline_type = GSK_VULKAN_PIPELINE_INSET_SHADOW;
else if (constants->clip.type == GSK_VULKAN_CLIP_RECT)
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_INSET_SHADOW_CLIP_ROUNDED;
else
- FALLBACK ("Inset shadow nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Inset shadow nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_INSET_SHADOW;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
case GSK_OUTSET_SHADOW_NODE:
if (gsk_outset_shadow_node_get_blur_radius (node) > 0)
- FALLBACK ("Blur support not implemented for outset shadows\n");
+ FALLBACK ("Blur support not implemented for outset shadows");
else if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
pipeline_type = GSK_VULKAN_PIPELINE_OUTSET_SHADOW;
else if (constants->clip.type == GSK_VULKAN_CLIP_RECT)
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_OUTSET_SHADOW_CLIP_ROUNDED;
else
- FALLBACK ("Outset shadow nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Outset shadow nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_OUTSET_SHADOW;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED;
else
- FALLBACK ("Cairo nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Cairo nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_SURFACE;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_COLOR_TEXT_CLIP_ROUNDED;
else
- FALLBACK ("Text nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Text nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_COLOR_TEXT;
}
else
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_TEXT_CLIP_ROUNDED;
else
- FALLBACK ("Text nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Text nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_TEXT;
}
op.text.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED;
else
- FALLBACK ("Texture nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Texture nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_TEXTURE;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_COLOR_CLIP_ROUNDED;
else
- FALLBACK ("Color nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Color nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_COLOR;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
case GSK_LINEAR_GRADIENT_NODE:
case GSK_REPEATING_LINEAR_GRADIENT_NODE:
if (gsk_linear_gradient_node_get_n_color_stops (node) > GSK_VULKAN_LINEAR_GRADIENT_PIPELINE_MAX_COLOR_STOPS)
- FALLBACK ("Linear gradient with %zu color stops, hardcoded limit is %u\n",
+ FALLBACK ("Linear gradient with %zu color stops, hardcoded limit is %u",
gsk_linear_gradient_node_get_n_color_stops (node),
GSK_VULKAN_LINEAR_GRADIENT_PIPELINE_MAX_COLOR_STOPS);
if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_LINEAR_GRADIENT_CLIP_ROUNDED;
else
- FALLBACK ("Linear gradient nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Linear gradient nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_LINEAR_GRADIENT;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_COLOR_MATRIX_CLIP_ROUNDED;
else
- FALLBACK ("Opacity nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Opacity nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_OPACITY;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_BLUR_CLIP_ROUNDED;
else
- FALLBACK ("Blur nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Blur nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_BLUR;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_COLOR_MATRIX_CLIP_ROUNDED;
else
- FALLBACK ("Color matrix nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Color matrix nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_COLOR_MATRIX;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
pipeline_type = GSK_VULKAN_PIPELINE_BORDER_CLIP_ROUNDED;
else
- FALLBACK ("Border nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Border nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_BORDER;
op.render.pipeline = gsk_vulkan_render_get_pipeline (render, pipeline_type);
g_array_append_val (self->render_ops, op);
graphene_matrix_multiply (&transform, &mv, &self->mv);
child = gsk_transform_node_get_child (node);
if (!gsk_vulkan_push_constants_transform (&op.constants.constants, constants, &transform, &child->bounds))
- FALLBACK ("Transform nodes can't deal with clip type %u\n", constants->clip.type);
+ FALLBACK ("Transform nodes can't deal with clip type %u", constants->clip.type);
op.type = GSK_VULKAN_OP_PUSH_VERTEX_CONSTANTS;
g_array_append_val (self->render_ops, op);
case GSK_CLIP_NODE:
{
if (!gsk_vulkan_push_constants_intersect_rect (&op.constants.constants, constants, gsk_clip_node_peek_clip (node)))
- FALLBACK ("Failed to find intersection between clip of type %u and rectangle\n", constants->clip.type);
+ FALLBACK ("Failed to find intersection between clip of type %u and rectangle", constants->clip.type);
if (op.constants.constants.clip.type == GSK_VULKAN_CLIP_ALL_CLIPPED)
return;
if (!gsk_vulkan_push_constants_intersect_rounded (&op.constants.constants,
constants,
gsk_rounded_clip_node_peek_clip (node)))
- FALLBACK ("Failed to find intersection between clip of type %u and rounded rectangle\n", constants->clip.type);
+ FALLBACK ("Failed to find intersection between clip of type %u and rounded rectangle", constants->clip.type);
if (op.constants.constants.clip.type == GSK_VULKAN_CLIP_ALL_CLIPPED)
return;
}
}
- GSK_NOTE (FALLBACK, g_print ("Node as texture not implemented for this case. Using %gx%g fallback surface\n",
+ GSK_RENDERER_NOTE (gsk_vulkan_render_get_renderer (render), FALLBACK, g_message ("Node as texture not implemented for this case. Using %gx%g fallback surface",
ceil (bounds->size.width),
ceil (bounds->size.height)));
#ifdef G_ENABLE_DEBUG
node = op->node;
- GSK_NOTE (FALLBACK,
- g_print ("Upload op=%s, node %s[%p], bounds %gx%g\n",
+ GSK_RENDERER_NOTE (gsk_vulkan_render_get_renderer (render), FALLBACK,
+ g_message ("Upload op=%s, node %s[%p], bounds %gx%g",
op->type == GSK_VULKAN_OP_FALLBACK_CLIP ? "fallback-clip" :
(op->type == GSK_VULKAN_OP_FALLBACK_ROUNDED_CLIP ? "fallback-rounded-clip" : "fallback"),
node->name ? node->name : node->node_class->type_name, node,
g_free (path);
if (bytes == NULL)
{
- GSK_NOTE (VULKAN, g_printerr ("Error loading shader data: %s\n", local_error->message));
+ GSK_NOTE (VULKAN, g_message ("Error loading shader data: %s", local_error->message));
g_propagate_error (error, local_error);
return NULL;
}